package com.yonyou.cyxdms.sysAuth.service.entity.role;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;

/**
 * <p>
 * 角色信息
 * </p>
 *
 * @author 李贺
 * @since 2019-09-18
 */
@TableName("tm_role")
public class RolePO extends DMSBasePO<RolePO> {

    private static final long serialVersionUID = 1L;

    /**
     * 角色id
     */
        @TableId(value = "ROLE_ID", type = IdType.AUTO)
        private Long roleId;
    /**
     * APP_ID
     */
    @TableField("APP_ID")
    private String appId;
    @TableField("COMPANY_ID")
    private Integer companyId;
    /**
     * 角色代码
     */
    @TableField("ROLE_CODE")
    private String roleCode;
    /**
     * 角色名称
     */
    @TableField("ROLE_NAME")
    private String roleName;
    /**
     * 数据来源
     */
    @TableField("DATA_SOURCE")
    private Integer dataSource;
    /**
     * 数据类型
     */
    @TableField("DATA_TYPE")
    private Integer dataType;

    /**
     * 角色类型
     */
    @TableField("ROLE_TYPE")
    private Integer roleType;

    /**
     * 数据类型
     */
    @TableField("IS_VALID")
    private Integer isValid;
    /**
     * 逻辑删除标志：是否删除
     */
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;
    
    /**
     * 更新时间
     */
    @TableField("UPDATED_AT")
    private LocalDateTime updatedAt;

    public RolePO() {
        super();
    }

    public Integer getRoleType() {
        return roleType;
    }

    public void setRoleType(Integer roleType) {
        this.roleType = roleType;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Integer getDataSource() {
        return dataSource;
    }

    public void setDataSource(Integer dataSource) {
        this.dataSource = dataSource;
    }

    public Integer getDataType() {
        return dataType;
    }

    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    @Override
    protected Serializable pkVal() {
        return this.roleId;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }
    
    

    @Override
    public LocalDateTime getUpdatedAt() {
		return updatedAt;
	}


	@Override
    public void setUpdatedAt(LocalDateTime updatedAt) {
		this.updatedAt = updatedAt;
	}


	@Override
    public String toString() {
        return "RolePO{" +
                "roleId=" + roleId +
                ", appId='" + appId + '\'' +
                ", companyId=" + companyId +
                ", roleCode='" + roleCode + '\'' +
                ", roleName='" + roleName + '\'' +
                ", dataSource=" + dataSource +
                ", dataType=" + dataType +
                ", isValid=" + isValid +
                ", isDeleted=" + isDeleted +
                ", updatedAt=" + updatedAt +
                '}';
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author 李贺
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "roleId");
    }


}
